<?php
//命名空间
namespace Shop\Widget;
//调用类库
use Think\Controller;
class IndexWidget extends Controller {

	//创建Widget扩展  ,传递到前台去 
	
    public function index(){
		$this->view("index");
    }
    
    
    
    //关于我们
	public function contentBottom(){
		$this->display("Widget/index.contentBottom");
	}
    
	
	
	/**
	 * 最好的产品
     * 传入widget参数 传入排序
     * Enter description here ...
     * @param unknown_type $price
     */
    public function bestSeller($param='datetime desc')
    {
    
    	
    	//$this->display();
    	
    	$newProlist=M("product")->order($param)->select();
    	$this->assign("newProList",$newProlist);
    	$this->display("Widget/index.bestseller");
    }
    
    
    /**
     * 最便宜的产品
     * 传入widget参数 传入排序
     * Enter description here ...
     * @param unknown_type $price
     */
	 public function indexPrice()
    {
    	$newProlist=M("product")->order('shop_price')->select();
    	$this->assign("newProList",$newProlist);
    	$this->display("Widget/index.price");
    }
    
    
    
    
    
}